app.controller('updateLineCustomerController', ['$scope', 'ajax', '$stateParams', '$state', 'lineCustomService', 'Flash', function ($scope, ajax, $stateParams, $state, lineCustomService, Flash) {

    //获取客户详情
    lineCustomService.detail($stateParams.lineCustomerId)
        .then(function (result) {
            $scope.linCustomerDetail = result;
        })


    //更新商品
    $scope.doLineCustomer = function (detail) {
        ajax.post({
            url: 'back/customer/update',
            data: detail,
            debug: true
        }).then(function (result) {
            Flash.create('success',  '修改成功', 'custom-class');
            $state.go('admin.lineCustomer')
        })
    }


}]);